package com.lx.generator.test.controller;


import com.lx.idgenerator.IDGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 对外提供的获取id服务
 *
 * @author 苏继宙
 * @version V1.0
 * @date: 14:00

 */
@RestController
@Validated
@RequestMapping("/generator/id")
public class IdGetterController {


   @Autowired
   IDGenerator idGenerator;
    @GetMapping(value = "/api/segment")
    public String getSegmentId(){
        return Long.toString(idGenerator.genId("1@test"));
    }


}
